#include "UriScheme.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* UriScheme_classType = NULL;
VTable* UriScheme_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Void make() */
void UriScheme_make(UriScheme* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::UriScheme.make not implemented yet"));
}


/* Str toStr() */
Str* UriScheme_toStr(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::UriScheme.toStr not implemented yet"));
}


/* UriScheme? find(Str scheme, Bool checked) */
UriScheme* UriScheme_find_1(Str* scheme)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::UriScheme.find not implemented yet"));
}


/* UriScheme? find(Str scheme, Bool checked) */
UriScheme* UriScheme_find(Str* scheme, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::UriScheme.find not implemented yet"));
}


/* Str scheme() */
Str* UriScheme_scheme(UriScheme* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::UriScheme.scheme not implemented yet"));
}


/* Obj? get(Uri uri, Obj? base) */
NullableObj UriScheme_get(UriScheme* self, Uri* uri, NullableObj base)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::UriScheme.get not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* UriScheme_initType(void)
{
  if (UriScheme_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = UriScheme_initVTable();
    Type* type = Type_new("UriScheme", baseType, vtable, sizeof(UriScheme), sizeof(UriSchemeVTable));
    Type_registerCtorImplementation(type, "make", UriScheme_make, 0);
    Type_registerMethodImplementation(type, "find", UriScheme_find_1, 1);
    Type_registerMethodImplementation(type, "find", UriScheme_find, 2);
    Type_registerMethodImplementation(type, "get", UriScheme_get, 2);
    Type_registerMethodImplementation(type, "scheme", UriScheme_scheme, 0);
    Type_registerMethodImplementation(type, "toStr", UriScheme_toStr, 0);
    UriScheme_classType = type;
    UriScheme_initStatic();
  }
  return UriScheme_classType;
}


VTable* UriScheme_initVTable(void)
{
  if (UriScheme_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(UriSchemeVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    ((FanObjVTable*)vtable)->toStr = UriScheme_toStr;
    ((UriSchemeVTable*)vtable)->get = UriScheme_get;
    UriScheme_classVTable = vtable;
  }
  return UriScheme_classVTable;
}


void UriScheme_initStatic(void)
{
}
